package day1901;

public class runjicheng {
    public static void main(String[] args) {
        runn a = new runn();
        Thread a1 = new Thread(a);
        Thread a2 = new Thread(a);
        Thread a3 = new Thread(a);
        Thread a4 = new Thread(a);

        a1.start();
        a2.start();
        a3.start();
        a4.start();
    }
}

class runn implements Runnable{
    int a =100;
    @Override
    public void run() {
        while (true){
            synchronized (this){
                if (a>0){
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(Thread.currentThread().getName()+" "+a--);
                }else
                    return;
            }

        }
    }
}